package com.chahua.organized.qo;

import com.chahua.organized.annotion.AllowValue;
import com.chahua.organized.constant.CommonConstant;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * @author chahua
 * @date 2022/4/9 22:13
 **/
@Data
public class DepartmentMemberQo {

    @ApiModelProperty("成员名称")
    @NotNull(message = "成员姓名不能为空")
    @Pattern(regexp = CommonConstant.NAME_REGEXP, message = "成员名称不能含有\"'&<>()+%这些特殊字符，且长度不能超过95个字符")
    private String name;

    @NotBlank
    @ApiModelProperty("手机号")
    @Pattern(regexp = CommonConstant.PHONE, message = "手机号码格式不正确")
    @Size(max = 20, message = "手机号码长度应小于等于20")
    private String phone;

    @ApiModelProperty("邮箱")
    @Pattern(regexp = CommonConstant.EMAIL, message = "电子邮箱格式不正确")
    @Size(max = 30, message = "电子邮箱长度应小于等于30")
    private String email;

    @ApiModelProperty("所属部门id")
    private Integer deptId;

    @ApiModelProperty("是否是主管，0-否，1-是")
    @AllowValue(vals = {0,1}, message = "是否是部门主管只能为0和1，0-否，1-是")
    private Integer isManager;

    @ApiModelProperty("岗位")
    @Pattern(regexp = CommonConstant.NAME_REGEXP, message = "岗位名称不能含有\"'&<>()+%这些特殊字符，且长度不能超过95个字符")
    private String post;
}
